package io;
/** 单字节写 */
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class FOSDemo {
    public static void main(String[] args) throws IOException {
        File file1=new File("fos1.dat");
        FileOutputStream fos1=new FileOutputStream(file1,true);
        fos1.write(1);
        fos1.write(2);
        System.out.println("写出完毕!");
        fos1.close();


        File file2=new File("fos2.dat");
        FileOutputStream fos2=new FileOutputStream(file2,true);
        fos2.write(3);
        fos2.write(4);
        System.out.println("写出完毕!");
        fos2.close();
    }
}
